package com.anywhere.freightman.order.service;

import com.anywhere.freightman.common.IBaseEntityService;
import com.anywhere.freightman.common.entity.ReportDayCount;
import com.anywhere.freightman.common.entity.order.DriverCarEntity;
import com.anywhere.freightman.common.entity.order.WaybillQueryEntity;
import com.anywhere.freightman.common.entity.user.Account;
import com.anywhere.freightman.common.enumeration.WaybillType;
import com.anywhere.freightman.external.controller.request.ExOrderRequest;
import com.anywhere.freightman.order.controller.request.WaybillOneRequest;
import com.anywhere.freightman.order.controller.request.WaybillRequest;
import com.anywhere.freightman.order.model.WaybillFileModel;
import com.anywhere.freightman.order.model.WaybillModel;

import java.util.Date;
import java.util.List;
import java.util.Map;

public interface IWaybillService extends IBaseEntityService<WaybillModel, WaybillQueryEntity> {

    WaybillModel getByNo(String orderNo);

    WaybillModel getByCode(String code);

    void updateCode(String orderNo);

    void close(String orderNo);

    List<DriverCarEntity> getListCarAndDriver(String orderNo);

    void accessCarAndDriver(String orderNo, Long carId, Long driverId, double price);

    void bindCarAndDriver(String orderNo, Long carId, Long driverId);

    void bindCarTrailerAndDriver(String orderNo, Long carId, Long driverId, Long trailerId);

    void bindCarAndDriver(String orderNo, Long carId, Long driverId, double price);

    void accessCarDriver(long id, Account account);

    void removeCarAndDriver(Long id);

    WaybillModel insert(WaybillRequest request, Long companyId);

    WaybillModel insertOne(WaybillOneRequest request, Long companyId);

    void sentToDriver(String orderNo);

    void payMark(String orderNo);

    void confirmOrder(String orderNo);

    boolean checkDriver(String orderNo, Long driverId);

    void accessOrder(String orderNo, Long driverId, Long carId);

    void accessOrder(String orderNo, Long driverId, Long carId, double price);

    void orderStart(String orderNo, Long driverId);

    void orderArrivals(String orderNo, Long driverId);

    void driverConfirmCode(String orderNo, Long driverId, String code);

    List<WaybillModel> getPublicList(String orderNo);

    List<WaybillModel> getOwnerList(long driverId, String orderNo, WaybillType type);

    void insertFile(String orderNo, Long fileId, Long driverId);

    List<WaybillFileModel> getFileList(String orderNo);

    List<WaybillFileModel> getFileList(String orderNo, Long driverId);

    void removeFile(long fileId);

    List<WaybillModel> getListByCompanyId(Long companyId);

    List<Map> getReportList(String dateFormat, Long companyId, Date startTime, Date endTime);

    List<ReportDayCount> getReportCount(Long companyId, String startTime, String endTime, String shipper, String receiver);

    List<String> getContinuousDate(String st, String et);

    List<String> create(String exOrderNo, ExOrderRequest order, long companyId);

    List<WaybillModel> getWayBillList(String exOrderNo);
}
